﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.Breeding.Infrastructure.Migrations
{
    public partial class 羊只管理 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "MeasureDate",
                table: "ConditionMeasure",
                type: "int",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldNullable: true);

            migrationBuilder.CreateTable(
                name: "DeathManage",
                columns: table => new
                {
                    DMId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Earbugles = table.Column<int>(type: "int", nullable: true),
                    DeathTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeathCause = table.Column<int>(type: "int", nullable: true),
                    Breed = table.Column<int>(type: "int", nullable: true),
                    Sex = table.Column<int>(type: "int", nullable: true),
                    Reproductive = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeathMonth = table.Column<int>(type: "int", nullable: false),
                    DeathDay = table.Column<int>(type: "int", nullable: false),
                    DeathDorm = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeathColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditorBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditorDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DocumentCord = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeathManage", x => x.DMId);
                });

            migrationBuilder.CreateTable(
                name: "OustManage",
                columns: table => new
                {
                    OMId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Earbugles = table.Column<int>(type: "int", nullable: true),
                    OustTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OustCause = table.Column<int>(type: "int", nullable: true),
                    Lingchatan = table.Column<int>(type: "int", nullable: true),
                    Dispose = table.Column<int>(type: "int", nullable: true),
                    Breed = table.Column<int>(type: "int", nullable: true),
                    Sex = table.Column<int>(type: "int", nullable: true),
                    Reproductive = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OustMonth = table.Column<int>(type: "int", nullable: false),
                    OustDay = table.Column<int>(type: "int", nullable: false),
                    OustDorm = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OustColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReviewBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReviewDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DocumentCord = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OustManage", x => x.OMId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DeathManage");

            migrationBuilder.DropTable(
                name: "OustManage");

            migrationBuilder.AlterColumn<DateTime>(
                name: "MeasureDate",
                table: "ConditionMeasure",
                type: "datetime2",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);
        }
    }
}
